home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / news / readers / nn-tk.001 / nn-tk~ / nn / news.h < prev    next >
C/C++ Source or Header  |  1995-07-28  |  3KB  |  100 lines

  1. /*
  2.  *    (c) Copyright 1990, Kim Fabricius Storm.  All rights reserved.
  3.  *
  4.  *    Interface for decoding article headers.
  5.  */
  6.  
  7. #ifndef _NN_NEWS_H
  8. #define _NN_NEWS_H 1
  9.  
  10. struct news_header {
  11.  
  12.     int    ng_flag;    /* flags:            */
  13. #      define N_DIGEST 1    /*   article is part of a digest*/
  14. #      define N_MODERATED 2    /*   group is moderated        */
  15.  
  16.     off_t    ng_fpos;    /* position of article text    */
  17.     off_t    ng_lpos;    /* last text offset        */
  18.                 /* header lines:        */
  19.     char    *ng_from;    /*   from            */
  20.     char    *ng_name;    /*   senders name        */
  21.     char    *ng_subj;    /*   subject            */
  22.     char    *ng_groups;    /*   newsgroups            */
  23.     char    *ng_path;    /*   path            */
  24.     char    *ng_reply;    /*   reply-to            */
  25.     char    *ng_ident;    /*   message id            */
  26.     char    *ng_follow;    /*   followup to        */
  27.     char    *ng_ref;    /*   references            */
  28.     char    *ng_keyw;    /*   keywords            */
  29.     char    *ng_dist;    /*   distibution        */
  30.     char    *ng_org;    /*   organization        */
  31.     char    *ng_appr;    /*   approved            */
  32.     char    *ng_summ;    /*   summary            */
  33.     char    *ng_control;    /*   control            */
  34.     char    *ng_sender;    /*   sender            */
  35.  
  36.     char    *ng_xref;    /*   xref            */
  37.     char    *ng_date;    /*   date            */
  38.  
  39.     char    *ng_rdate;    /*   date-received (News 3)    */
  40.     char    *ng_bref;    /*   back-references (News 3)    */
  41.     char    *ng_origr;    /*   originator            */
  42.  
  43.     char    *ng_xlines;    /*   lines (from header)    */
  44.     int    ng_lines;    /*   lines (decoded)        */
  45.     char    *ng_comment;    /*   comment-to (rfmail)    */
  46.     char    *ng_mime;       /*   Mime version               */
  47.     char    *ng_content;    /*   Mime content type          */
  48.     char    *ng_encode;     /*   Mime transfer encoding     */
  49. } news;
  50.  
  51.  
  52. /*
  53.  * digest article subheader
  54.  */
  55.  
  56. struct digest_header {
  57.     off_t    dg_hpos;    /* position of article header    */
  58.     off_t    dg_fpos;    /* position of article text    */
  59.     off_t    dg_lpos;    /* last text position        */
  60.                 /* header lines:        */
  61.     char    *dg_date;    /*   date            */
  62.     char    *dg_from;    /*   from            */
  63.     char    *dg_subj;    /*   subject            */
  64.     char    *dg_to;        /*   to                */
  65.  
  66.     int    dg_lines;    /*   lines (pseudo field)    */
  67. } digest;
  68.  
  69.  
  70. #define    NEWS_HEADER_BUFFER    2048
  71.  
  72. typedef char    news_header_buffer[NEWS_HEADER_BUFFER];
  73.  
  74.  
  75. FILE *open_news_article(/* header, modes [, buffer1 [, buffer2]] */);
  76.  
  77. /* modes */
  78.  
  79. #define    FILL_NEWS_HEADER    0x0001    /* parse first header -> buffer1 */
  80. #define    FILL_DIGEST_HEADER    0x0002    /* parse second header -> buffer[12] */
  81.  
  82.  
  83. #define    GET_ALL_FIELDS        0x0010    /* get all fields (otherwise only   */
  84.                     /* name, subj, groups, lines        */
  85.  
  86. #define    GET_DATE_ONLY        0x0020    /* get Date field            */
  87.  
  88. #define    FILL_OFFSETS        0x0080    /* fill ng_[hfl]pos */
  89.  
  90.  
  91. #define    DIGEST_CHECK        0x0100    /* set N_DIGEST if "digest" in subj */
  92.                     /* only valid with FILL_NEWS_HEADER */
  93. #define LAZY_BODY        0x0200    /* nntp: get body only for digests */
  94.  
  95.  
  96. #define    SKIP_HEADER        0x1000    /* position after (sub) header */
  97.  
  98.  
  99. #endif /* _NN_NEWS_H */
  100.